package palms.locationserver;

import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;

import javax.crypto.spec.SecretKeySpec;

import palms.security.PalmsSecurityManager;

public class LocationLogic {

	private int slport;
	
	private SecretKeySpec keySl;
	
	public LocationLogic(){
		this.init();
	}
	
	public void init(){
		
		this.setSlport(56424);
		
		try {
			//SL key
			String slk = "locationlocationlocationlocation";
			this.setKeySl(PalmsSecurityManager.getKeyFromString(slk));
			
		} catch (NoSuchAlgorithmException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void setSlport(int slport) {
		this.slport = slport;
	}

	public int getSlport() {
		return slport;
	}

	public void setKeySl(SecretKeySpec keySl) {
		this.keySl = keySl;
	}

	public SecretKeySpec getKeySl() {
		return keySl;
	}
	
}
